<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="a">元素a</div>
    <br />
    <button id="b">元素b</button>
    <br />
    <span id="c">元素c</span>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script>
    <script>
      $(function () {
        var a = $('#a'),
          b = $('#b'),
          c = $('#c')

        a.add(b)
          .add(c)
          .on('click', function () {
            console.log($(this).html())
          })
      })
    </script>
  </body>
</html>
